package com.crr.demo.bean;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializeConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.crr.demo.utils.DateUtils;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;

/**
 * 用户实体
 */
public class User implements Serializable {
    private Long id;
    private String identityId;
    private String name;
    private String pwd;
    private Long role;
    private Long active;
    private String createTime;
    private String updateTime;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String deleteTime;

    public  JSONObject getUserMsg(){
        JSONObject jsonObject  = new JSONObject(16, true);
        JSON.toJSONStringZ(jsonObject, SerializeConfig.getGlobalInstance(), SerializerFeature.QuoteFieldNames);
        jsonObject.put("id",id);
        jsonObject.put("identityId",identityId);
        jsonObject.put("name", name);
        jsonObject.put("role",role);
        jsonObject.put("active",active);
        jsonObject.put("createTime",createTime);
        jsonObject.put("updateTime",updateTime);
        if(deleteTime!=null){
            jsonObject.put("deleteTime",deleteTime);
        }
        return jsonObject;
    }



    public String getIdentityId() {
        return identityId;
    }

    public void setIdentityId(String identityId) {
        this.identityId = identityId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getRole() {
        return role;
    }

    public void setRole(Long role) {
        this.role = role;
    }

    public Long getActive() {
        return active;
    }

    public void setActive(Long active) {
        this.active = active;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(String deleteTime) {
        this.deleteTime = deleteTime;
    }
}
